<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>transform</title>
    <style>
      .wrap {
        width: 300px;
        height: 300px;
        background-color: burlywood;
      }
      .target {
        width: 60px;
        height: 80px;
        background-color: cadetblue;
        /* translate 表示平移 横向纵向移动 margin */
        /* transform:translate(20px); */
        /* rotate表示旋转 单位是deg */
        /* transform: rotate(45deg); */
        /* scale 表示缩放 1为不缩放 */
        transform: scale(1);
        /* 多个变形同时使用 先平移 再旋转 最后考虑缩放 */
        /* transform:translate(20px,40px) rotate(45deg) scale(0.8) */
      }
    </style>
  </head>
  <body>
    <div>xxxx</div>
    <div class="wrap">
      <div class="target"></div>
    </div>
    <div class="wrapper">
      <div class="foo">福</div>
    </div>
    <style>
      .wrapper {
        width: 100px;
        height: 100px;
        background-color: darkgray;
      }
      .foo {
        text-align: center;
        line-height: 50px;
        font-size: 30px;
        width: 50px;
        height: 50px;
        background-color: crimson;
        animation-name: transformer,op;
        animation-duration: 5s,2s;
        animation-iteration-count: infinite,3;
      }

      @keyframes transformer {
        from {
          transform: translate(0) rotate(0) scale(0.5);
        }
        to {
          transform: translate(50%, 50%) rotate(45deg) scale(1.2);
        }
      }
      @keyframes op {
        from {
          opacity: 0.1;
        }
        to {
          opacity: 1;
        }
      }
    </style>
  </body>
</html>
